/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFrame.java
 *
 * Created on 05-sep-2011, 22:45:14
 */
package com.devmonsters.sqlquerytool.ui;

import javax.swing.JOptionPane;

/**
 *
 * @author fernando
 */
public class MainFrame extends javax.swing.JFrame {

    /** Creates new form MainFrame */
    public MainFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        toolbar = new javax.swing.JToolBar();
        btConnect = new javax.swing.JButton();
        mainSplitPane = new javax.swing.JSplitPane();
        queryListPane = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        workspacePanes = new javax.swing.JTabbedPane();
        workspaceSplitPane = new javax.swing.JSplitPane();
        queryPane = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();
        resultSetPane = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea2 = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SQL Query Tool");
        setBounds(new java.awt.Rectangle(50, 50, 1280, 1024));

        toolbar.setRollover(true);

        btConnect.setText("Connect to server");
        btConnect.setFocusable(false);
        btConnect.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btConnect.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btConnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btConnectActionPerformed(evt);
            }
        });
        toolbar.add(btConnect);

        mainSplitPane.setDividerLocation(250);

        jLabel1.setText("Queries list");

        jScrollPane3.setViewportView(jTree1);

        javax.swing.GroupLayout queryListPaneLayout = new javax.swing.GroupLayout(queryListPane);
        queryListPane.setLayout(queryListPaneLayout);
        queryListPaneLayout.setHorizontalGroup(
            queryListPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(queryListPaneLayout.createSequentialGroup()
                .addComponent(jLabel1)
                .addContainerGap(176, Short.MAX_VALUE))
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
        );
        queryListPaneLayout.setVerticalGroup(
            queryListPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(queryListPaneLayout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE))
        );

        mainSplitPane.setLeftComponent(queryListPane);

        workspaceSplitPane.setDividerLocation(350);
        workspaceSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);

        jLabel2.setText("Some info on current workspace/query");

        jEditorPane1.setText("-- current query");
        jScrollPane1.setViewportView(jEditorPane1);

        javax.swing.GroupLayout queryPaneLayout = new javax.swing.GroupLayout(queryPane);
        queryPane.setLayout(queryPaneLayout);
        queryPaneLayout.setHorizontalGroup(
            queryPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(queryPaneLayout.createSequentialGroup()
                .addComponent(jLabel2)
                .addGap(125, 125, 125))
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
        );
        queryPaneLayout.setVerticalGroup(
            queryPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(queryPaneLayout.createSequentialGroup()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE))
        );

        workspaceSplitPane.setTopComponent(queryPane);

        jTextArea2.setColumns(20);
        jTextArea2.setRows(5);
        jTextArea2.setText("resultset");
        jScrollPane2.setViewportView(jTextArea2);

        javax.swing.GroupLayout resultSetPaneLayout = new javax.swing.GroupLayout(resultSetPane);
        resultSetPane.setLayout(resultSetPaneLayout);
        resultSetPaneLayout.setHorizontalGroup(
            resultSetPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 370, Short.MAX_VALUE)
        );
        resultSetPaneLayout.setVerticalGroup(
            resultSetPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
        );

        workspaceSplitPane.setRightComponent(resultSetPane);

        workspacePanes.addTab("Current workspace", workspaceSplitPane);

        mainSplitPane.setRightComponent(workspacePanes);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(toolbar, javax.swing.GroupLayout.DEFAULT_SIZE, 656, Short.MAX_VALUE)
            .addComponent(mainSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 656, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(toolbar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(mainSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 525, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btConnectActionPerformed

        JOptionPane.showMessageDialog(this, "Shall connect to database server");     }//GEN-LAST:event_btConnectActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btConnect;
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTextArea jTextArea2;
    private javax.swing.JTree jTree1;
    private javax.swing.JSplitPane mainSplitPane;
    private javax.swing.JPanel queryListPane;
    private javax.swing.JPanel queryPane;
    private javax.swing.JPanel resultSetPane;
    private javax.swing.JToolBar toolbar;
    private javax.swing.JTabbedPane workspacePanes;
    private javax.swing.JSplitPane workspaceSplitPane;
    // End of variables declaration//GEN-END:variables
}
